FROM golang:alpine AS builder

#设置环境变量
ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn,direct \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64

WORKDIR /build

COPY . .

RUN go build -o app .

FROM scratch

COPY ./configs /configs

COPY --from=builder /build/app /

ENTRYPOINT ["/app", "configs/config.yaml"]
